package com.example.itas;

import java.util.ArrayList;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.ListView;

import com.example.classes.ReviewContainerAdapter;
import com.example.classes.ReviewInfo;

public class ReviewContainerActivity extends Activity {

	private Button btn_review;
	private ListView listview;
	private static ArrayList<ReviewInfo> reviewInfoBeanList = new ArrayList<ReviewInfo>();
	ReviewContainerAdapter adapter;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_review_container);
		
		listview = (ListView) findViewById(R.id.listView1);
		adapter = new ReviewContainerAdapter(this, R.layout.row, reviewInfoBeanList);
		listview.setAdapter(adapter);
		
		//reviewInfoBeanList.add(new ReviewInfo("It is Nice", "Cool", 5));//temp data
		
		btn_review = (Button) findViewById(R.id.room_btn_review2);
		btn_review.setOnClickListener(new OnClickListener(){

			public void onClick(View v) {
				// TODO Auto-generated method stub
				Intent i = new Intent(ReviewContainerActivity.this, EvaluationActivity.class);
				startActivity(i);
			}
			
		});
	}

	
	public static ArrayList<ReviewInfo> getContainer(){
		return reviewInfoBeanList;
	}
}
